import { createRouter, createWebHistory } from 'vue-router'
import Main from '../views/main.vue'
import NotfoundVue from '@/views/notfound.vue'
import Login from '@/views/login.vue'
import arr from './config.js'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/main',
      name: 'main',
      component: Main
    },
    {
      path: '/',
      redirect:'/main'
    },
    {
      path:'/:path(.*)*',
      component:NotfoundVue
    },
    {
      path:'/login',
      name:'login',
      component:Login
    }
  ]
})

arr.forEach(item=>{
  router.addRoute('main',item)
})
export default router
